package com.dragon.mmochat.model.scheduleJob;

import org.quartz.Job;
import org.quartz.JobExecutionContext;

import com.dragon.mmochat.MmochatConstant;
import com.dragon.mmochat.model.activity.MmochatPayAwardActivity;
import com.dragon.mmochat.service.MmochatChatService;

public class PayAwardJob implements Job {
	@Override
	public void execute(JobExecutionContext context) {
		try {
			MmochatPayAwardActivity payAward = (MmochatPayAwardActivity) context
					.getJobDetail().getJobDataMap().get("data");
			if (payAward != null) {
				MmochatConstant.exchangeRate = payAward.getExchangeRate();
				if (payAward.getSystemMsg() != null) {
					MmochatChatService.sendSystemMsg(payAward.getSystemMsg());
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
